package com.mall.user.domain.model;

import com.mall.goods.common.exception.BusinessException;

public record StateRemark(String stateRemark) {
    public StateRemark{
        if(stateRemark.length()>100){
            throw new IllegalArgumentException("禁售原因长度不能超过100个字符");
        }

        if(stateRemark==null||"".equals(stateRemark)){
            throw new BusinessException("禁售原因不能为空");
        }
    }

    public static StateRemark of(String stateRemark){
        return new StateRemark(stateRemark);
    }



}
